//
//  UIView+Xib.m
//  JFBase
//
//  Created by Alan Wang on 2019/5/15.
//  Copyright © 2019 Alan Wang. All rights reserved.
//

#import "UIView+Xib.h"
#import "NSBundle+AppIcon.h"
#import "JFStringHelper.h"

@implementation UIView (Xib)
+ (UIView *)loadXibViewWithNibName:(NSString *)name{
    return [self loadXibViewWithNibName:name buddleName:nil];
}
+ (UIView *)loadXibViewWithNibName:(NSString *)name buddleName:(NSString*)buddleName{
    
    if ([JFStringHelper isNotEmpty:name]) {
        NSBundle * buddle = [NSBundle bundleWithName:buddleName];
        if (!buddle) {
            buddle = [NSBundle mainBundle];
        }
        return [[buddle loadNibNamed:name owner:nil options:nil] firstObject];
    }else{
        return nil;
    }
}
@end
